package fun.tan90.wx.pay;

import com.wechat.pay.java.core.Config;
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
import com.wechat.pay.java.core.cipher.Signer;

public final class WxPayConstant {

    /**
     * 商户号
     * 铁人科技-智慧场馆
     */
    public static final String mchId = "1647128609";

    /**
     * 商户API私钥
     */
    private static final String privateKey = "-----BEGIN PRIVATE KEY-----MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDOvtQTFV7SFtqf4pHqXL0GFbz6y3fG4eMXzsvLccB/uCTOPSkGFDevOD8H+5baxkXirF88LozkgruHV0iQ+wAez2D6YSB1FSQY4/4KIWPW851FknFVd9yTb1654T/eBnNDnNfJv9hDYqsBZ0hU/OvC568fpf5i945mRy6pdBeuASKu5egprKtCrU7Z5aZ5d/8m5MJyECJgaBNQHGZgQjeWEkhyVF9BZF5IOOYYau/7O0mVB5EPOsa5sNff6ksvmbsKHkCggSAs7FYw0kzRJ4/pzgo2hyDZDWzvpkZWsMVKqBxdhITHChh9ngZx2IJJ2daZNm6OAHOiKfYX8x9J1yKZAgMBAAECggEBAMj+mOscoZyZ/13lRXqVQmeCBsHDweSmgsMIlvRo2H7SpWWj7Bgu25wLkKvQGm8Cx7qBXe0CTJNzzaDcaH4ap5lMf7mrZ4SsUvWn4bgzkf7NxJ54qpou91CWu372z8KofrLC7r8DNdr9N8cbhCSr5wELgSPBmzjX96bTmTfA16yfSMF4t6U+lJg/rDIN0MppE9vtFpQ9gPECK0AvEvDi79OMrURRUEkvzRyAtLvkuaF7oJABTJbadEsZvSJMg8mV8fJqcGv/BU8CtrofekT8fd/B9Ipa/WTkFFshBAyq2hjGU6ZK1BeDOBm5TTvwm+BoZVmTCRoaD07jKVnA4/cceQECgYEA/EGyI/CHN81Q6P3qxRjMme4OcR9KeRDeNbRGwOnDJ3r3oikBVZAcjBC4gDBioARU+fEFyfuI7KOHZ1jty3Ac7AyCgffD26+/XfWfg7IFqOcJH6E17X6Xr7ztYZTrEFRyBu3N8zD7dYAL8a92IEBOiGBjl/6htUnuqbe4J/aQYokCgYEA0dA9J+7WWqwf5Muu4aJEZeaqi0Xh1qvd3z0U8t96W+op03wDNvkMheHpbCXa2umcehqX6w+mAqljPa0HnMHZ5f77IK3uyaC36V6WdBVwJQPQhuuwZR7HgemQ2pvc//p+IcsKE4qiBE9EHvGgyFSQ+tl52IIZH25Do39gZgUb+5ECgYEAz7kNh3jW8EWbHfGR9PHB8fPNYqvAuMcCJLkqFkuoz4b8CkW3+oxsZY6TT8QIQvquOw+Vk8kU7MCQjLL3RjIxLtPyWDH9z5b+f9H2pAzhij+ODMTE0qgPIsDxvQxTMSRIrZn/oQYx24Uw0LmLDW3G/ZhaCty8rruN06Yc+JOaO/kCgYBo+o9O5rK75XmDyeHzpXQhpFtamhmYhp/Z7b8IkoavbKeG2HrnS49XgaSAZyRs+gxAEARJKag/lq9AEc5IQbob2Quf20cp/U9n5drTtFJLQvBYQZ8dyVu7hbjjmK7oKVZo5CVjh67vBxYngXCYK6/qw1uy181oK4yORtJd2VqZ8QKBgGWz2li6YJ+w/pmeLHNDdGGRpMF19qn8wV/hlMgNXJM++UrW0BOPo2rV+knIrI6rb7o/bFOjQqQXAGyPwPlbVEtx/JTqI9AJHzwIG4N3t1NWySEHBx/opY/pUG37znBKq1lsg0AkDwfiB/2G1MC+LURXY3PaL9a3t/oSHp2xcaBh-----END PRIVATE KEY-----";

    /**
     * 商户API证书
     */
    private static final String cert = "-----BEGIN CERTIFICATE-----MIIEITCCAwmgAwIBAgIUIqoeVTTCD1oBf11u8QzPtKU68m8wDQYJKoZIhvcNAQELBQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsTFFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3QgQ0EwHhcNMjUwOTExMDEyNzEwWhcNMzAwOTEwMDEyNzEwWjB7MRMwEQYDVQQDDAoxNjQ3MTI4NjA5MRsw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9/IKm6OXVK+ppR/TI5MyyOxwrexIdCF1KTmg3TCwlgEFSZJ67uPQSaCrb+NAeSzVin5OfhlvNA8=-----END CERTIFICATE-----";

    /**
     * 商户证书序列号
     */
    private static final String merchantSerialNumber = "22AA1E5534C20F5A017F5D6EF10CCFB4A53AF26F";

    /**
     * 商户APIV3密钥
     */
    private static final String apiV3key = "RUmQ6L8WIDVQAYzIa8yQFoW4xefuDNya";

    // 使用自动更新平台证书的RSA配置
    // 建议将 config 作为单例或全局静态对象，避免重复的下载浪费系统资源
    public static Config CONFIG =
            new RSAAutoCertificateConfig.Builder()
                    .merchantId(mchId)
                    .privateKey(privateKey)
                    .merchantSerialNumber(merchantSerialNumber)
                    .apiV3Key(apiV3key)
                    .build();

    public static Signer SIGNER = CONFIG.createSigner();

    public static final String ORDER_NOTIFY_URL = "https://tan90-wx.iepose.cn/wx-pay/callback/order";

    public static final String REFUND_NOTIFY_URL = "https://tan90-wx.iepose.cn/wx-pay/callback/refunds";
}
